package hu.ikti.oamadmin.types.entities;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "BUNDLE")
@SequenceGenerator(sequenceName = "BUNDLE_SEQ", name = "B_SEQ", allocationSize = 1)
public class Bundle {

	private Long id;
	private BundleData bundleData;

	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "B_SEQ")
	public Long getId() {
		return id;
	}

	@OneToOne(cascade = CascadeType.PERSIST)
	@JoinColumn(name = "BUNDLEDATA_FK", nullable = false)
	public BundleData getBundleData() {
		return bundleData;
	}

	public void setBundleData(BundleData bundleData) {
		this.bundleData = bundleData;
	}

	public void setId(Long id) {
		this.id = id;
	}

}
